addProp(description, #PrevButtonSprite, [#comment: "What channel is Previous Button: ", #format: #integer, #default: the currentSpriteNum + 1])
addProp(description, #nextButtonSprite, [#comment: "What channel is Next Button: ", #format: #integer, #default: the currentSpriteNum + 2])
return description
end
on getBehaviorDescription
return "Prepares a sprite to use a Series of adjacent Bitmap castmembers to represent an set of mutually exclusive states that the user can cycle through. See below for usage. " & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Item Name - ( optional ) name of this control." & RETURN & "ΓÇó First Image - number of first castmember in the sequence." & RETURN & "ΓÇó Last Image - number of last castmember in the sequence." & RETURN & "ΓÇó Cycle Mode - specifies how images in cycle are repeated on subsequent iterations. The Repeat mode repeats the same sequence. The Reverse mode cycles back through the sequence in reverse order." & RETURN & "ΓÇó Reverse Order - proceed from last to first image by default." & RETURN & "MESSAGES:" & RETURN & "ΓÇó CycleState - advance to the next image in the sequence, or the previous image, if the GoingDown property is true. & RETURN & "ΓÇó SetState state_number - advance directly to position state_number in the sequence."
end
on getAssocMembers
set myPropList to []
repeat with x = the number of member MemberMinCast + 1 to the number of member MemberMaxCast
add(myPropList, the number of member x)
end repeat
return myPropList
end
on beginSprite me
set the membermin of me to the number of member the MemberMinCast of me
set the membermax of me to the number of member the MemberMaxCast of me
set the textCount of me to the membermax of me - the membermin of me + 1
set the spriteNum of me to the spriteNum of me
set the currentCount of me to 1
set the ImageCastLib of me to the number of castLib the castLibNum of sprite the spriteNum of me
setstate(me, the currentCount of me)
end
on endSprite me
puppetSprite(the spriteNum of me, 0)
end
on setstate me, textNum
if textNum > textCount then
set textNum to textCount
else
if textNum < 1 then
set textNum to 1
end if
end if
set the member of sprite spriteNum to membermin + currentCount - 1